package org.one.afternoon.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.one.afternoon.domain.EdgeData;

import java.util.Date;
import java.util.List;

@Mapper
public interface EdgeMapper {
    @Insert("insert into edge_data (file_path, lat, lon, create_at) values (#{path},#{lat},#{lon},#{createAt})")
    void insertOne(String path, String lat, String lon, Date createAt);

    @Select("select * from edge_data where status = 0")
    List<EdgeData> selectNewEdges();

    @Update("update edge_data set status = 1 where id = #{id}")
    boolean updateById(int id);
}
